package edu.zjut.hjg.saas.kwmp.web.model;

import edu.zjut.hjg.saas.biz.support.RoleName;

public class UserSession {
    private String   loginId;
    private String   name;
    private Integer  id;
    private RoleName roleName;

    public boolean isAdmin() {
        return this.roleName == RoleName.ADMIN;
    }

    public boolean isTeacher() {
        return this.roleName == RoleName.TEACHER;
    }

    public boolean isParent() {
        return this.roleName == RoleName.PARENT;
    }

    public String getLoginId() {
        return loginId;
    }

    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }

    public RoleName getRoleName() {
        return roleName;
    }

    public void setRoleName(RoleName roleName) {
        this.roleName = roleName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "UserSession [id=" + id + ", loginId=" + loginId + ", name=" + name + "]";
    }
}
